<?php
namespace app\api\model\sms;
use app\logic\model\LogicModel;
use think\Model;
use think\facade\Db;
use app\api\common;
class SmsTemplate extends LogicModel {
    protected $name='sms_template';
	private $table_obj;
	public function getSetting($where,$field='*'){
		extract(common::get('sms_template',[$where,$field]));
		if(empty($data)){
			$data=Db::name("sms_template")->where($where)->field($field)->find();
		}
		return $data;
	}
	
	/**
	 *
	 * 存储数据 
	 */
	
	public function setting_insert($data_insert){
		common::delete("sms_template");
		return Db::name('sms_template')->strict(false)->insert($data_insert);
	}
	/**
	 * 更新
	 * 
	 */
	public function setting_update($up,$where){
		common::delete("sms_template");
		return Db::name('sms_template')
		    ->where($where)
		    ->update($up);
	}
}
?>